(function($){
    $(function(){
    	
    	var $subbtn = $("#submit_btn");
        $('#submitForm').validator({
           theme:'yellow_right_effect',
           stopOnError: false,
           timely: 1,
           focusCleanup:true,
           fields: {
               'title': '标题:required;length[1~50];'
           },
           valid: function(){
        	   $subbtn.attr("disabled",true);
        	   $subbtn.val("正在保存，请稍候...");
               $('#submitForm')._ajaxForm(function(r){
                   asyncbox.tips(r.m,r.r==0 ? 'success' : 'error');
                   if(r.r==0) {
                	   fileFunc.isDel = false;
                	   fileFunc.del("save");
                	   fileUpload.isDel = false;
                	   fileUpload.del("save");
                       setTimeout(function(){
                           document.location.reload();
                       }, 2000);
                   }else{
                	   $subbtn.attr("disabled",false);
                	   $subbtn.val("确认保存");
                   }
               });
           }
        });
    });
})(jQuery);